package main;

import java.io.IOException;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.GameCanvas;

public class GameOverCanvas  extends GameCanvas {
	protected final MainMidlet game;
	protected Image background;

	protected GameOverCanvas(MainMidlet midlet,boolean win) {
		super(true);
		this.game = midlet;
		setFullScreenMode(true);
		try {
			if(win){
				background = Image.createImage("/win_background.png");
			}else{
				background = Image.createImage("/lose_background.png");
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	protected void pointerPressed(int x, int y) {
		
	}

	protected void pointerReleased(int x, int y) {
		game.showMenuCanvas();
	}

	protected void pointerDragged(int x, int y) {
	}

	public void paint(Graphics g) {
		g.drawImage(background, 0, 0, 0);
	}
}